<?php

namespace App\Http\Controllers\Api\V1\Resources;

use Illuminate\Http\Resources\Json\JsonResource;
use Illuminate\Support\Facades\Storage;

class divinationItemResource extends JsonResource
{
    public function toArray($request)
    {
    	$resource = $this->resource;
    	
        return [
            'id' =>$resource->id,
        	'content' =>$resource->content,
	        'image'=>Storage::disk('public')->url($resource->image),
            'words'=>$resource->words,
            'essential' =>$resource->essential,
            'chongjie' =>$resource->chongjie,
            'title'=>$resource->title,
            'symbol'=>$resource->symbol,
            'cause'=>$resource->cause,
	        'created_at' => (string)$resource->created_at,
        ];
    }
}
